package mpcs.controller
{
	import mpcs.NotiConst;
	import mpcs.model.UserInfoProxy;
	import mpcs.model.vo.BasicInfoVO;
	import mpcs.model.vo.ContactInfoVO;
	import mpcs.model.vo.UserVO;
	
	import org.puremvc.as3.interfaces.INotification;
	import org.puremvc.as3.patterns.command.SimpleCommand;
	
	public class UserInfoCommand extends SimpleCommand {
		
		private var proxy:UserInfoProxy;
		
		public function UserInfoCommand() {
			super();
			
			proxy = facade.retrieveProxy(UserInfoProxy.NAME) as UserInfoProxy;
		}
		
		override public function execute(notification:INotification):void{
			var name:String = notification.getName();
			switch(name){
				case NotiConst.S_BASICINFO:
					proxy.sBasicInfo(UserVO(notification.getBody()));
					break;
				case NotiConst.S_SAVE_BASICINFO:
					proxy.sSaveBasicInfo(BasicInfoVO(notification.getBody()));
					break;
				case NotiConst.S_CONTACTINFO:
					proxy.sContactInfo(UserVO(notification.getBody()));
					break;
				case NotiConst.S_SAVE_CONTACTINFO:
					proxy.sSaveContactInfo(ContactInfoVO(notification.getBody()));
					break;
				case NotiConst.S_UPDATEPWD:
					proxy.sUpdatePwd( notification.getBody() as String );
					break;
				case NotiConst.S_MOBILELIST:
					proxy.sMobileList();
					break;
				case NotiConst.S_SAVE_INIT_POSITION:
					proxy.sSaveInitPosition(notification.getBody());
					break;
			}
		}
		
		
	}
}